[
[	sysdefs
[				INTERPRETER SPECIFIC DEFINITIONS
[



[**************    ACTIONS   **************]

%action	return()								0

[Variable actions
%action	increment(VAR)							1
%action	decrement(VAR)							2
%action	assignn(VAR, NUM)						3
%action	assignv(VAR, VAR)						4
%action	addn(VAR, NUM)							5
%action	addv(VAR, VAR)							6
%action	subn(VAR, NUM)							7
%action	subv(VAR, VAR)							8
%action	lindirectv(VAR, VAR)					9
%action	rindirect(VAR, VAR)						10
%action	lindirectn(VAR, NUM)					11

%action	set(FLAG)								12
%action	reset(FLAG)							13
%action	toggle(FLAG)							14
%action	set.v(VAR)							15
%action	reset.v(VAR)							16
%action	toggle.v(VAR)							17

[Logics
%action	new.room(NUM)							18
%action	new.room.f(VAR)						19
%action	load.logics(NUM)						20
%action	load.logics.f(VAR)						21
%action	call(NUM)								22
%action	call.f(VAR)							23

[Pictures
%action	load.pic(VAR)							24
%action	draw.pic(VAR)							25
%action	show.pic()							26
%action	discard.pic(VAR)						27
%action	overlay.pic(VAR)						28
%action	show.pri.screen()						29

[Views
%action	load.view(VIEW)						30
%action	load.view.f(VAR)						31
%action	discard.view(VIEW)						32

[Animated objects
%action	animate.obj(OBJECT)						33
%action	unanimate.all()						34
%action	draw(OBJECT)							35
%action	erase(OBJECT)							36
%action	position(OBJECT, NUM, NUM)				37
%action	position.f(OBJECT, VAR, VAR)				38
%action	get.posn(OBJECT, VAR, VAR)				39
%action	reposition(OBJECT, VAR, VAR)				40

[Views of animated objects
%action	set.view(OBJECT, VIEW)					41
%action	set.view.f(OBJECT, VAR)					42
%action	set.loop(OBJECT, NUM)					43
%action	set.loop.f(OBJECT, VAR)					44
	%define	facing.right			0
	%define	facing.left			1
	%define	facing.front			2
	%define	facing.back			3
%action	fix.loop(OBJECT)						45
%action	release.loop(OBJECT)					46
%action	set.cel(OBJECT, NUM)					47
%action	set.cel.f(OBJECT, VAR)					48
%action	last.cel(OBJECT, VAR)					49
%action	current.cel(OBJECT, VAR)					50
%action	current.loop(OBJECT, VAR)				51
%action	current.view(OBJECT, VAR)				52
%action	number.of.loops(OBJECT, VAR)				53

[Priority control of animated objects
%action	set.priority(OBJECT, NUM)				54
%action	set.priority.f(OBJECT, VAR)				55
%action	release.priority(OBJECT)					56
%action	get.priority(OBJECT, VAR)				57

[Attributes of animated objects
%action	stop.update(OBJECT)						58
%action	start.update(OBJECT)					59
%action	force.update(OBJECT)					60
%action	ignore.horizon(OBJECT)					61
%action	observe.horizon(OBJECT)					62
%action	set.horizon(NUM)						63
%action	object.on.water(OBJECT)					64
%action	object.on.land(OBJECT)					65
%action	object.on.anything(OBJECT)				66
%action	ignore.objs(OBJECT)						67
%action	observe.objs(OBJECT)					68
%action	distance(OBJECT, OBJECT, VAR)				69

[Cycling of animated objects
%action	stop.cycling(OBJECT)					70
%action	start.cycling(OBJECT)					71
%action	normal.cycle(OBJECT)					72
%action	end.of.loop(OBJECT, FLAG)				73
%action	reverse.cycle(OBJECT)					74
%action	reverse.loop(OBJECT, FLAG)				75
%action	cycle.time(OBJECT, VAR)					76
%define	cycle.frequency	cycle.time

[Motion of animated objects
%action	stop.motion(OBJECT)						77
%action	start.motion(OBJECT)					78
%action	step.size(OBJECT, VAR)					79
%action	step.time(OBJECT, VAR)					80
%define	step.frequency		step.time
%action	move.obj(OBJECT, NUM, NUM, NUM, FLAG)		81
%action	move.obj.f(OBJECT, VAR, VAR, VAR, FLAG)		82
			[object,  x,  y,  stepsize (preferably 0),  flag to set upon arrival
%action	follow.ego(OBJECT, NUM, FLAG)				83
%action	wander(OBJECT)							84
%action	normal.motion(OBJECT)					85
%action	set.dir(OBJECT, VAR)					86
%action	get.dir(OBJECT, VAR)					87

%action	ignore.blocks(OBJECT)					88
%action	observe.blocks(OBJECT)					89
%action	block(NUM, NUM, NUM, NUM)				90
%action	unblock()								91

[Inventory objects
%action	get(OBJECT)							92
%action	get.f(VAR)							93
%action	drop(OBJECT)							94
%action	put(OBJECT, VAR)						95
%action	put.f(VAR, VAR)						96
%action	get.room.f(VAR, VAR)					97

[Sounds
%action	load.sound(NUM)						98
%action	sound(NUM, FLAG)						99
%action	stop.sound()							100

[Screen Display
%action	print(MSGNUM)							101
%action	print.f(VAR)							102
%action	display(NUM, NUM, MSGNUM)				103
			[row, col, message
%action	display.f(VAR, VAR, VAR)					104
			[row, col, message
%action	clear.lines(NUM, NUM, NUM)				105
			[top row, bottom row, attribute
%action	text.screen()							106
%action	graphics()							107
%action	set.cursor.char(MSGNUM)					108
%action	set.text.attribute(NUM, NUM)				109
%action	shake.screen(NUM)						110

[Screen handling
%action	configure.screen(NUM, NUM, NUM)			111
[			picture row, input row, status row
%action	status.line.on()						112
%action	status.line.off()						113

[String handling
%action	set.string(NUM, MSGNUM)					114
%action	get.string(NUM, MSGNUM, NUM, NUM, NUM)		115
				[string#, prompt, row, col, max length
%action	word.to.string(NUM, NUM)					116
				[word#, string#
%action	parse(NUM)							117
%action	get.num(MSGNUM, VAR)					118

[Input handling
%action	prevent.input()						119
%action	accept.input()							120
%action	set.key(NUM, NUM, NUM)					121
	%define	joystick.low.byte	1
	%define	button0			1
	%define	button1			2
	%define	button0.double		3
	%define	button1.double		4

[Add to picture
%action	add.to.pic(VIEW, NUM, NUM, NUM, NUM, NUM, NUM)	122
				[view, loop, cel,  x,   y, obj priority, box priority
%action	add.to.pic.f(VAR, VAR, VAR, VAR, VAR, VAR, VAR)	123
				[view, loop, cel,  x,   y, obj priority, box priority
%define	add.to.picture		add.to.pic
%define	add.to.picture.f	add.to.pic.f

[User requested actions
%action	status()								124
%action	save.game()							125
%action	restore.game()							126
%action	init.disk()							127
%action	restart.game()							128

[Show object view
%action	show.obj(VIEW)							129

[Miscellaneous
%action	random(NUM, NUM, VAR)					130
%action	program.control()						131
%action	player.control()						132
%action	obj.status.f(VAR)						133
%action	quit(NUM)								134
		[0 = prompt
		[1 = immediate
%action	show.mem()							135
%action	pause()								136
%action	echo.line()							137
%action	cancel.line()							138
%action	init.joy()							139
%action	toggle.monitor()						140
%action	version()								141
%action	script.size(NUM)						142
%action	set.game.id(MSGNUM)						143
%action	log(MSGNUM)							144
%action	set.scan.start()						145
%action	reset.scan.start()						146

%action	reposition.to(OBJECT, NUM, NUM)			147
%action	reposition.to.f(OBJECT, VAR, VAR)			148

%action	trace.on()							149
%action	trace.info(NUM, NUM, NUM)				150
				[logic #, position of top of window, number of lines

%action	print.at(MSGNUM, NUM, NUM, NUM)			151
				[msg #, row, col, width
%action	print.at.v(VAR, NUM, NUM, NUM)			152
				[msg #, row, col, width

%action	discard.view.v(VAR)						153

%action	clear.text.rect(NUM, NUM, NUM, NUM, NUM)	154
				[top, left, bottom, right, attribute

%action	set.upper.left(NUM, NUM)					155
				[x, y

%action	set.menu(MSGNUM)						156
				[menu name]
%action	set.menu.item(MSGNUM, NUM)				157
				[item name, controller number]
%action	submit.menu()							158
				[terminate menu collecting]
%action	enable.item(NUM)						159
				[enable item corresponding to controller]
%action	disable.item(NUM)						160
				[disable item corresponding to controller]
%action	menu.input()							161
#action	show.obj.v(VAR)						162	[	2/3/87SM

#action	open.dialogue()						163
#action	close.dialogue()						164

#action	mul.n(VAR, NUM)						165
#action	mul.v(VAR, VAR)						166
#action	div.n(VAR, NUM)						167
#action	div.v(VAR, VAR)						168

#action	close.window()							169




[**************     TESTS    **************]

%test	equaln(VAR, NUM)					1
%test	equalv(VAR, VAR)					2
%test	lessn(VAR, NUM)					3
%test	lessv(VAR, VAR)					4
%test	greatern(VAR, NUM)					5
%test	greaterv(VAR, NUM)					6
%test	isset(FLAG)						7
%test	isset.v(VAR)						8
%test	has(OBJECT)						9
%test	obj.in.room(OBJECT, VAR)				10
%test	posn(OBJECT, NUM, NUM, NUM, NUM)		11
%test	controller(NUM)					12
%test	have.key()						13
%test	said(WORDLIST)						14
%define	said1		said
%define	said3		said
%test	compare.strings(NUM, NUM)			15
%test	obj.in.box(OBJECT, NUM, NUM, NUM, NUM)	16
%test	center.posn(OBJECT, NUM, NUM, NUM, NUM)	17
%test	right.posn(OBJECT, NUM, NUM, NUM, NUM)	18



[************** 	VARS    **************

%var		current.room			0
%var		previous.room			1
%var		edge.ego.hit			2
	%define	not.hit		0		
	%define	top			1		
	%define	right		2		
	%define	bottom		3		
	%define	left			4
%var		score				3
%var		obj.hit.edge			4
%var		edge.obj.hit			5
%var		ego.dir				6
	%define	ego.stopped	0
	%define	ego.up		1
	%define	ego.up.right	2
	%define	ego.right		3
	%define	ego.down.right	4
	%define	ego.down		5
	%define	ego.down.left	6
	%define	ego.left		7
	%define	ego.up.left	8
%var		max.score				7
%var		memory.left			8
%var		unknown.word			9
%var		animation.interval		10
%var		elapsed.seconds		11
%var		elapsed.minutes		12
%var		elapsed.hours			13
%var		elapsed.days			14
%var		double.click.delay		15
%var		current.ego			16
%var		error.number			17
%var		error.parameter		18
%var		last.char				19
%var		machine.type			20
	#define	PC			0		[PC, compatibles
	#define	JR			1		[PCjr
	#define	TANDY		2		[Tandy 1000
	#define	APPLEII		3		[Apple IIe, IIc
	#define	ST			4		[Atari ST
	#define	AMIGA		5		[Amiga
	#define	MAC			6		[Fat Mac, Mac Plus
	#define	CORTLAND		7		[?
%var		print.timeout			21	[in 1/2 second increments
%var		number.of.voices		22	[number of music voices on this machine
%var		attenuation			23	[0 - 15 == loud - off
%var		input.length			24	[max length of user input allowed
%var		selected.object		25
#var		monitor.type			26
	#define	composite		0		[	2/3/87SM
	#define	rgb			1		[
	#define	mono			2		[
	#define	ega			3		[


[************** 	FLAGS    **************

%flag	on.water				0
%flag	ego.hidden			1
%flag	have.input			2
%flag	hit.special			3
%flag	have.match			4
%flag	init.log				5
%flag	restart.in.progress		6
%flag	no.script				7
%flag	enable.double.click		8
%flag	sound.on				9
%flag	enable.trace			10
%flag	has.noise.channel		11		[set if machine has noise channel
%flag	restore.in.progress		12
%flag	enable.obj.select		13
%flag	enable.menu			14
%flag	leave.window			15
%flag	no.prompt.restart		16



[************	  CONSTANTS   **************]

[	screen boundaries:
%define	top.edge			0
%define	bottom.edge		167
%define	left.edge			0
%define	right.edge 		159
%define	screen.top		0
%define	screen.bottom		167
%define	screen.left		0
%define	screen.right		159
%define	fall.through		200		[makes ego move off screen

[	maximum value storable:
%define	max.flag.value		255
%define	error			-1	[	2/3/87SM
